
from sanic import Sanic
from app.middleware.authentication import authRequestMiddleware
from app.middleware.default import middlewareResponse, print_on_request


requestMiddleware=[
    print_on_request,
    authRequestMiddleware
]

responseMiddleware=[
    middlewareResponse
]

def initMiddleware(app:Sanic):
    for fun in requestMiddleware:
        app.register_middleware(fun,"request")
    
    for fun in responseMiddleware:
        app.register_middleware(fun,"response")